<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>求和</title>
</head>
<body>
        <script>
        var i = 0;
        var s =0;
        /**
         * 1 2 3 4
         * s = s + 1
         * s = s + 2
         * s = s + 3
         * s = s + 4
         */
        while (i<=10){
            s = s + i;
            console.log(s);
            i++
        }
        </script>
</body>
</html>